DEFINITION MODULE GEMVDI;

(*
GEMVDI Definitions.

UK __DATE__ __TIME__
*)

(*DEF_SWITCHES*)

IMPORT VDI,
       VControl;

CONST EOS = VDI.EOS;

TYPE Key = VDI.Key;

TYPE SpecialKeys = VDI.SpecialKeys;
#if no_enum_reexport
CONST KRShift = VDI.KRShift;
                    KLShift,
                    KCtrl,
                    KAlt,
#endif
TYPE SpecialKey = PACKEDSET OF SpecialKeys;

TYPE HorizontalOffsetTable = ARRAY[0..255] OF UNSIGNEDWORD;
     CharacterOffsetTable = ARRAY[0..256] OF UNSIGNEDWORD;

TYPE FontFlags = 

(SystemFont,
                  HorizontalOffset,
                  ByteSwapped,
                  MonoSpaced,

TYPE FontFlag = SET OF FontFlags;

     FontPtr = POINTER TO FontHdr;
     FontHdr = RECORD

TYPE ImgHeader = RECORD

     ScanLine = RECORD

     ColorModels = (RGB,CYM,HLS,Pantone);

     ColorIntensity = [0..1000];

     RGBList = RECORD

     XImgHeader = RECORD

CONST White    = 0;
      Black    = 1;
      Red      = 2;
      Green    = 3;
      Blue     = 4;
      Cyan     = 5;
      Yellow   = 6;
      Magenta  = 7;
      LWhite   = 8;
      LBlack   = 9;
      LRed     = 10;
      LGreen   = 11;
      LBlue    = 12;
      LCyan    = 13;
      LYellow  = 14;
      LMagenta = 15;

      DWhite   = 8;
      DBlack   = 9;
      DRed     = 10;
      DGreen   = 11;
      DBlue    = 12;
      DCyan    = 13;
      DYellow  = 14;
      DMagenta = 15;

TYPE ContrlArray = ARRAY[0..11] OF UNSIGNEDWORD;

     VectorBlock = RECORD

     ControlBlock = RECORD

VAR contrl: ControlBlock;

CONST MaxInput = 256; (* VGText() ! *)
      MaxOutput = 256; (* VRQString() ! *)

TYPE Integer = SIGNEDWORD;

     IntegerInputRange = [0..(MaxInput - 1)];
     IntegerOutputRange = [0..(MaxOutput - 1)];

     IntegerInput = ARRAY IntegerInputRange OF Integer;
     IntegerOutput = ARRAY IntegerOutputRange OF Integer;

VAR intin : IntegerInput;
    intout: IntegerOutput;

CONST MinPoints = 128;
      MaxPoints = 1024; (* should be enough *)

TYPE Point = UNSIGNEDWORD;

     PointsInputRange = [0..(MaxPoints * 2  - 1)];
     PointsOutputRange = [0..9]; (*  VQTFontInfo() ! *)

     PointsInput = ARRAY PointsInputRange OF Point;
     PointsOutput = ARRAY PointsOutputRange OF Point;

VAR ptsin : PointsInput;
    ptsout: PointsOutput;

CONST MaxNDC = 32767;

TYPE XY = [0..MaxNDC];

TYPE PB = RECORD

VAR v: PB;

PROCEDURE vdi;

PROCEDURE CallVDI(opcode,nptsin,nintin,handle: UNSIGNEDWORD);

PROCEDURE CallEsc(escno,handle: UNSIGNEDWORD);

PROCEDURE CallVDIEsc(escno,nptsin,nintin,handle: UNSIGNEDWORD);

PROCEDURE Result(): SIGNEDWORD;

END GEMVDI.
